@extends('app')

@section('content')
    <div class="layui-card" style="height:100vh;">
        <div class="layui-fluid">
            <div class="layui-row layui-col-space15">
                <div class="layui-col-md12">
                    @component('form.form',['id'=>'form'])
                        @include('form.select',[
                            'label'     => '上级分类',
                            'name'      => 'pid',
                            'class'     => 'layui-col-md12',
                            'val'       => $cates,
                            'first'     => '顶级分类',
                            'checked'   => empty($model->pid)?$pid:$model->pid
                        ])

                        @include('form.input',[
                            'label' => '分类名称',
                            'name'  => 'name',
                            'class' => 'layui-col-md12',
                            'val'   => $model->name??''
                        ])

                        @include('form.uploadImgs',[
                            'name'  => 'icon',
                            'label' => '分类图标',
                            'must'  => false,
                        ])

                        @include('form.input',[
                            'label' => '排序',
                            'name'  => 'sort',
                            'class' => 'layui-col-md12',
                            'val'   => $model->sort??'99'
                        ])

                        @include('form.submit',['label'=>'立即提交','form'=>'form','reload'=>"parent.location.reload('treeTable');"])
                    @endcomponent
                </div>
            </div>
        </div>
    </div>
@endsection

@section('js')

@endsection